<extend name='Yg/index' />
<block name='main'>
<div id="page-wrapper" style="background-image:url('__PUBLIC__/css/a.jpeg');">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h2 class="page-header">
                            员工餐饮
                        </h2>
                        <ol class="breadcrumb">
                            <li class="active">
                                <i class="fa fa-dashboard"></i> 您的位置 => 民以食为天
                            </li>
                        </ol>
                    </div>
                </div>
                <div class='h4' style='width:850px;'>
                    <form class="form-horizontal" action="<{:U('Food/count')}>" method="post">
                        <p style="color:red;font-size:20px;">您最近想吃啥?(最多选择3项哦~)</p>
                        <div class='h4'>
                        <table>
                        <volist name='food' id='vo' mod='5'>
                        <label>
                            <input type='checkbox' name='food[]' value='<{$vo.id}>'><{$vo.food}>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </label>         
                            <eq name="mod" value="4"><br/></eq>
                        </volist>
                        </table>
                        <br>
                        <p style="color:red;font-size:20px;">啥口味风格呢?(最多选择3项哦~)</p>
                        <table>
                        <volist name='taste' id='vo' mod='5'>
                        <label>
                            <input type='checkbox' name='taste[]' value='<{$vo.id}>'><{$vo.taste}>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </label>         
                            <eq name="mod" value="4"><br/></eq>
                        </volist>
                        </table>
                        <br>
                            <input type='submit' class='btn btn-warning' value='我选好啦'>
                        </div>      
                </form>
                </div>
                <script type="text/javascript">
                //限制多选框选中个数
                    $(document).ready(function() {
                      $('input[type=checkbox]').click(function() {
                       $("input[name='food[]']").attr('disabled', true);
                       $("input[name='taste[]']").attr('disabled', true);

                       if ($("input[name='food[]']:checked").length >= 3) {
                        $("input[name='food[]']:checked").attr('disabled', false);
                       } else {
                        $("input[name='food[]']").attr('disabled', false);
                       }
                        if ($("input[name='taste[]']:checked").length >= 3) {
                        $("input[name='taste[]']:checked").attr('disabled', false);
                       } else {
                        $("input[name='taste[]']").attr('disabled', false);
                       }
                      });
                     })
                </script>
                <!-- /.row -->
                     
            </div>
            <!-- /.container-fluid -->

        </div>
        <!-- /#page-wrapper -->
</block>